home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / Apple II / Essentials / MPW IIGS Interfaces / PIIGSIncludes / Dialogs.p < prev    next >
Encoding:
Text File  |  1990-08-01  |  6.4 KB  |  192 lines  |  [TEXT/MPS ]

  1. {********************************************
  2. ; File: Dialogs.p
  3. ;
  4. ;
  5. ; Copyright Apple Computer, Inc. 1986-90
  6. ; All Rights Reserved
  7. ;
  8. ********************************************}
  9.  
  10. UNIT DIALOGS;
  11.  
  12. INTERFACE
  13.  
  14. USES TYPES,QUICKDRAW,EVENTS,CONTROLS,WINDOWS,LINEEDIT;
  15.  
  16. CONST
  17. { Error Codes }
  18. badItemType = $150A;
  19. newItemFailed = $150B;
  20. itemNotFound = $150C;
  21. notModalDialog = $150D;
  22.  
  23. { Command Codes }
  24. getInitView = $0001;
  25. getInitTotal = $0002;
  26. getInitValue = $0003;
  27. scrollLineUp = $0004;
  28. scrollLineDown = $0005;
  29. scrollPageUp = $0006;
  30. scrollPageDown = $0007;
  31. scrollThumb = $0008;
  32.  
  33. { Item Type Codes }
  34. buttonItem = $000A;
  35. checkItem = $000B;
  36. radioItem = $000C;
  37. scrollBarItem = $000D;
  38. userCtlItem = $000E;
  39. statText = $000F;
  40. longStatText = $0010;
  41. editLine = $0011;
  42. iconItem = $0012;
  43. picItem = $0013;
  44. userItem = $0014;
  45. userCtlItem2 = $0015;
  46. longStatText2 = $0016;
  47. itemDisable = $8000;
  48.  
  49. { Item Type Ranges }
  50. minItemType = $000A;
  51. maxItemType = $0016;
  52.  
  53. { ItemID Codes }
  54. ok = $0001;
  55. cancel = $0002;
  56.  
  57. { Part Codes }
  58. inButton = $0002;
  59. inCheckBox = $0003;
  60. inRadioButton = $0004;
  61. inUpArrow = $0005;
  62. inDownArrow = $0006;
  63. inPageUp = $0007;
  64. inPageDown = $0008;
  65. inStatText = $0009;
  66. inGrow = $000A;
  67. inEditLine = $000B;
  68. inUserItem = $000C;
  69. inLongStatText = $000D;
  70. inIconItem = $000E;
  71. inLongStatText2 = $000F;
  72. inThumb = $0081;
  73.  
  74. { Stage Bit Vectors }
  75. okDefault = $0000;
  76. cancelDefault = $0040;
  77. alertDrawn = $0080;
  78.  
  79. { Other Constants }
  80. {$IFC UNDEFINED atItemListLength }  { AlertTemplate - Default number of Item Templates }
  81. atItemListLength = $0005;
  82. {$SETC atItemListLength := 0}
  83. {$ENDC}
  84. {$IFC UNDEFINED dtItemListLength }  { DialogTemplate - Default number of Item Templates }
  85. dtItemListLength = $0008;
  86. {$SETC dtItemListLength := 0}
  87. {$ENDC}
  88.  
  89. TYPE
  90.  
  91. DialogPtr = GrafPortPtr ;
  92.  
  93. ItemTempHndl = ^ItemTempPtr;
  94. ItemTempPtr = ^ItemTemplate;
  95. ItemTemplate = RECORD
  96.     itemID : Integer;
  97.     itemRect : Rect;
  98.     itemType : Integer;
  99.     itemDescr : Ptr;
  100.     itemValue : Integer;
  101.     itemFlag : Integer;
  102.     itemColor : Ptr; { pointer to appropriate type of color table }
  103. END;
  104.  
  105. AlertTempHndl = ^AlertTempPtr;
  106. AlertTempPtr = ^AlertTemplate;
  107. AlertTemplate = PACKED RECORD
  108.     atBoundsRect : Rect;
  109.     atAlertID : Integer;
  110.     atStage1 : Byte;
  111.     atStage2 : Byte;
  112.     atStage3 : Byte;
  113.     atStage4 : Byte;
  114.     atItemList : ARRAY[1..atItemListLength] OF ItemTempPtr; { Null terminated array }
  115. END;
  116.  
  117. DlgTempHndl = ^DlgTempPtr;
  118. DlgTempPtr = ^DialogTemplate;
  119. DialogTemplate = RECORD
  120.     dtBoundsRect : Rect;
  121.     dtVisible : Boolean;
  122.     dtRefCon : Longint;
  123.     dtItemList : ARRAY[1..dtItemListLength] OF ItemTempPtr; { Null terminated array }
  124. END;
  125.  
  126. UserCtlItemPBHndl = ^UserCtlItemPBPtr;
  127. UserCtlItemPBPtr = ^UserCtlItemPB;
  128. UserCtlItemPB = RECORD
  129.     defProcParm : LongProcPtr;
  130.     titleParm : Ptr;
  131.     param2 : Integer;
  132.     param1 : Integer;
  133. END;
  134.  
  135. FUNCTION Alert ( alertTemplatePtr:AlertTemplate; filterProcPtr:WordProcPtr) : Integer ;
  136. FUNCTION CautionAlert ( alertTemplatePtr:AlertTemplate; filterProcPtr:WordProcPtr) : Integer ;
  137. PROCEDURE CloseDialog ( theDialogPtr:DialogPtr)  ;
  138. FUNCTION DefaultFilter ( theDialogPtr:DialogPtr; theEventPtr:EventRecord;VAR itemHitPtr:Integer) : Boolean ;
  139. PROCEDURE DialogBootInit   ;
  140. PROCEDURE DialogReset   ;
  141. FUNCTION DialogSelect ( theEventPtr:EventRecord;VAR resultPtr:WindowPtr;VAR itemHitPtr:Integer) : Boolean ;
  142. PROCEDURE DialogShutDown   ;
  143. PROCEDURE DialogStartUp ( userID:Integer)  ;
  144. FUNCTION DialogStatus  : Boolean ;
  145. FUNCTION DialogVersion  : Integer ;
  146. PROCEDURE DisableDItem ( theDialogPtr:DialogPtr; itemID:Integer)  ;
  147. PROCEDURE DlgCopy ( theDialogPtr:DialogPtr)  ;
  148. PROCEDURE DlgCut ( theDialogPtr:DialogPtr)  ;
  149. PROCEDURE DlgDelete ( theDialogPtr:DialogPtr)  ;
  150. PROCEDURE DlgPaste ( theDialogPtr:DialogPtr)  ;
  151. PROCEDURE DrawDialog ( theDialogPtr:DialogPtr)  ;
  152. PROCEDURE EnableDItem ( theDialogPtr:DialogPtr; itemID:Integer)  ;
  153. PROCEDURE ErrorSound ( soundProcPtr:VoidProcPtr)  ;
  154. FUNCTION FindDItem ( theDialogPtr:DialogPtr; thePoint:Point) : Integer ;
  155. FUNCTION GetAlertStage  : Integer ;
  156. FUNCTION GetControlDItem ( theDialogPtr:DialogPtr; itemID:Integer) : CtlRecHndl ;
  157. FUNCTION GetDefButton ( theDialogPtr:DialogPtr) : Integer ;
  158. PROCEDURE GetDItemBox ( theDialogPtr:DialogPtr; itemID:Integer; itemBoxPtr:Rect)  ;
  159. FUNCTION GetDItemType ( theDialogPtr:DialogPtr; itemID:Integer) : Integer ;
  160. FUNCTION GetDItemValue ( theDialogPtr:DialogPtr; itemID:Integer) : Integer ;
  161. FUNCTION GetFirstDItem ( theDialogPtr:DialogPtr) : Integer ;
  162. PROCEDURE GetIText ( theDialogPtr:DialogPtr; itemID:Integer;VAR text:Str255)  ;
  163. PROCEDURE GetNewDItem ( theDialogPtr:DialogPtr; itemTemplatePtr:ItemTemplate)  ;
  164. FUNCTION GetNewModalDialog ( dialogTemplatePtr:DialogTemplate) : DialogPtr ;
  165. FUNCTION GetNextDItem ( theDialogPtr:DialogPtr; itemID:Integer) : Integer ;
  166. PROCEDURE HideDItem ( theDialogPtr:DialogPtr; itemID:Integer)  ;
  167. FUNCTION IsDialogEvent ( theEventPtr:EventRecord) : Boolean ;
  168. FUNCTION ModalDialog ( filterProcPtr:WordProcPtr) : Integer ;
  169. FUNCTION ModalDialog2 ( filterProcPtr:WordProcPtr) : Longint ;
  170. PROCEDURE NewDItem ( theDialogPtr:DialogPtr; itemID:Integer; itemRectPtr:Rect; itemType:Integer; itemDescr:Ptr; itemValue:Integer; itemFlag:Integer; itemColorPtr:Ptr)  ;
  171. FUNCTION NewModalDialog ( dBoundsRectPtr:Rect; dVisibleFlag:Boolean; dRefCon:Longint) : DialogPtr ;
  172. FUNCTION NewModelessDialog ( dBoundsRectPtr:Rect; dTitle:Str255; dBehindPtr:DialogPtr; dFlag:Integer; dRefCon:Longint; dFullSizePtr:Rect) : DialogPtr ;
  173. FUNCTION NoteAlert ( alertTemplatePtr:AlertTemplate; filterProcPtr:WordProcPtr) : Integer ;
  174. PROCEDURE ParamText ( param0:Str255; param1:Str255; param2:Str255; param3:Str255)  ;
  175. PROCEDURE RemoveDItem ( theDialogPtr:DialogPtr; itemID:Integer)  ;
  176. PROCEDURE ResetAlertStage   ;
  177. PROCEDURE SelectIText ( theDialogPtr:DialogPtr; itemID:Integer; startSel:Integer; endSel:Integer)  ;
  178. PROCEDURE SelIText ( theDialogPtr:DialogPtr; itemID:Integer; theStringPtr:StringPtr)  ;
  179. PROCEDURE SetDAFont ( fontHandle:FontHndl)  ;
  180. PROCEDURE SetDefButton ( defButtonID:Integer; theDialogPtr:DialogPtr)  ;
  181. PROCEDURE SetDItemBox ( theDialogPtr:DialogPtr; itemID:Integer; itemBoxPtr:Rect)  ;
  182. PROCEDURE SetDItemType ( itemType:Integer; theDialogPtr:DialogPtr; itemID:Integer)  ;
  183. PROCEDURE SetDItemValue ( itemValue:Integer; theDialogPtr:DialogPtr; itemID:Integer)  ;
  184. PROCEDURE SetIText ( theDialogPtr:DialogPtr; itemID:Integer; theString:Str255)  ;
  185. PROCEDURE ShowDItem ( theDialogPtr:DialogPtr; itemID:Integer)  ;
  186. FUNCTION StopAlert ( alertTemplatePtr:AlertTemplate; filterProcPtr:WordProcPtr) : Integer ;
  187. PROCEDURE UpdateDialog ( theDialogPtr:DialogPtr; updateRgnHandle:RegionHndl)  ;
  188.  
  189. IMPLEMENTATION
  190.  
  191. END.
  192.